package com.blackhorse.controller;

import com.blackhorse.domain.Order;
import com.blackhorse.service.impl.OrderServiceImpl5;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试seata分布式事务的controller
 * 使用时打开RestController注解
 */
@Slf4j
//@RestController
public class OrderController5 {
    @Autowired
    private OrderServiceImpl5 orderService;

    /**
     * 用户下单接口
     */
    @RequestMapping("/order/prod/{pid}")
    public Order order(@PathVariable("pid") Integer pid) {
        return orderService.createOrder(pid);
    }
}
